Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved table data display #6

Merged
merged 9 commits into from
Jan 17, 2025
Merged

Improved table data display #6

merged 9 commits into from
Jan 17, 2025

Conversation

ozppupbg
Copy link
Contributor

Hello,

I really liked the idea of this plugin, but I wanted to display array object content in a very customizable way.
So I added a couple of features and now it works for me.

The main change is the possibility to add column formatting:
#qj-format: table[<flags>:<field or template>:<link field>=<custom name>,<flags>:<field or template>:<link field>=<custom name>,...]
For example:
#qj-format: table[h:title=Name,:value,b:test=Value 2]
with a template:
#qj-format: table[:"Custom {value} of {test}"=Something]

The following flags are implemented:

  • b: display bold
  • h: header column/field (only allowed in the first entry)
  • l: create a link - a second field name must be provided, which contains the link URL
  • c: if a list of values is the content, use comma separation for the entries
  • n: if a list of values is the content, use new-line/
    separation for the entries

This is a quick demonstration of the new features:
JSON Query Test.md
test01.json

Feel free to use all ideas or cherry-pick as you see fit.

There are also some other minor fixes and changes, e.g.:

  • JSON content in markdown can now actually be used
  • better matching of qj-headers
  • Allow filtering on top-level JSON arrays

@Rooyca
Copy link
Owner

Rooyca commented Jan 17, 2025

Hey @ozppupbg, I love this!
Thank you so much for this PR. <3

@Rooyca Rooyca merged commit 390a6ff into Rooyca:master Jan 17, 2025
@Rooyca
Copy link
Owner

Rooyca commented Jan 17, 2025

Just one thing, it would be very helpful to write a How to use on the README.

Rooyca added a commit that referenced this pull request Jan 17, 2025
Rooyca added a commit that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants